from django.shortcuts import render

# Create your views here.
from django.views.generic import ListView, DetailView, CreateView, UpdateView
from django.contrib.auth.mixins import LoginRequiredMixin
from .models import CrmCustomer


# class CustomerListView(LoginRequiredMixin, ListView):
#     model = CrmCustomer
#     template_name = "crm/customer_list.html"
#     context_object_name = "customers"
#
#     def get_queryset(self):
#         # 权限控制：管理员看所有客户，销售只看自己负责的
#         user = self.request.user
#         if user.is_superuser:
#             return CrmCustomer.objects.all()
#         return CrmCustomer.objects.filter(assigned_to=user)